<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use App\Base\Annotation\Common;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/**
 * @ApiResource()
 * @ODM\Document(repositoryClass="App\Repository\OrderCancelRepository")
 */
class OrderCancel
{
    /**
     * @Common(cnName="#",editType="text",listType="text")
     * @ODM\Id(strategy="INCREMENT")
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @Common(cnName="用户",editType="entity",listType="text")
     * @ODM\ReferenceOne(targetDocument="App\Entity\User")
     * @ORM\ManyToOne(targetEntity="App\Entity\User")
     */
    private $user;

    /**
     * @Common(cnName="订单",editType="entity",listType="text")
     * @ODM\ReferenceOne(targetDocument="App\Entity\Orders", inversedBy="package")
     * @ORM\ManyToOne(targetEntity="App\Entity\Orders")
     */
    private $orders;

    /**
     * @Common(cnName="申请时间",editType="text",listType="text")
     * @ODM\Field( type="date", nullable=true)
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $createAt;

    /**
     * @Common(cnName="处理时间",editType="text",listType="text")
     * @ODM\Field( type="date", nullable=true)
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $dealAt;

    /**
     * @Common(cnName="状态",editType="text",listType="text")
     * @ODM\Field( type="raw", nullable=true)
     * @ORM\Column(type="integer", nullable=true)
     */
    private $status;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): self
    {
        $this->user = $user;

        return $this;
    }

    public function getOrders(): ?Orders
    {
        return $this->orders;
    }

    public function setOrders(?Orders $orders): self
    {
        $this->orders = $orders;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeInterface
    {
        return $this->createAt;
    }

    public function setCreateAt(?\DateTimeInterface $createAt): self
    {
        $this->createAt = $createAt;

        return $this;
    }

    public function getDealAt(): ?\DateTimeInterface
    {
        return $this->dealAt;
    }

    public function setDealAt(?\DateTimeInterface $dealAt): self
    {
        $this->dealAt = $dealAt;

        return $this;
    }

    public function getStatus(): ?int
    {
        return $this->status;
    }

    public function setStatus(?int $status): self
    {
        $this->status = $status;

        return $this;
    }
}
